using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.IO;
using NetWorkMsg;
using NetMsg.App;
using NetMsg.Gate;

namespace NetMsg.Player
{
    public enum PlayerGuideFlag
    {
        FirstCall,
        // 第一次进入战斗
        EnterFight,
        SecondCall,
        // 添加白希
        ReqAddNpc,
        FirstChat,
        // 弹球引导
        PinballTutorial,
        // 娱乐赛
        EntertainmentCardMatch,
        // 第一次失败
        FightLost,
        End,
    }
    
    public class LoginInfoP : IUnPackable
    {
        public long PlayerId;
        public Sex Sex;
        public string Name;
        public int Head;
        public int Gold;
        public int Diamond;
        public int DataExp;
        public int Stamina;
        public BitArray Guides;
        public int RecoveryStaminaStartTime;
        public AppSetInfo AppSetInfo;
        
        public const uint Sid = 86;
        
        public void UnPack(MemoryStream stream)
        {
            UnPackAuxiliary.Read(stream, out ulong var0);
            PlayerId = (long)var0;
            UnPackAuxiliary.Read(stream, out uint var1);
            Sex = (Sex)var1;
            UnPackAuxiliary.Read(stream, out Name);
            UnPackAuxiliary.Read(stream, out uint var2);
            Head = (int)var2;
            UnPackAuxiliary.Read(stream, out uint var3);
            Gold = (int)var3;
            UnPackAuxiliary.Read(stream, out uint var4);
            Diamond = (int)var4;
            UnPackAuxiliary.Read(stream, out uint var5);
            DataExp = (int)var5;
            UnPackAuxiliary.Read(stream, out uint var6);
            Stamina = (int)var6;
            UnPackAuxiliary.Read(stream, out Guides);
            UnPackAuxiliary.Read(stream, out uint var7);
            RecoveryStaminaStartTime = (int)var7;
            AppSetInfo = new AppSetInfo();
            AppSetInfo.UnPack(stream);
        }
    }
    
    public class ChangeNameQ : IIdPackable
    {
        public string Name;
        
        public uint PackableId => 117;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 117u);
            PackAuxiliary.Write(stream, Name);
        }
    }
    
    public struct DayRefreshP : IUnPackable
    {
        
        public const uint Sid = 87;
        
        public void UnPack(MemoryStream stream)
        {
        }
    }
    
    public struct SetGuideQ : IIdPackable
    {
        public PlayerGuideFlag Flag;
        
        public uint PackableId => 118;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 118u);
            PackAuxiliary.Write(stream, (uint)Flag);
        }
    }
    
    public struct RecoveryStaminaP : IUnPackable
    {
        public int Stamina;
        
        public const uint Sid = 88;
        
        public void UnPack(MemoryStream stream)
        {
            UnPackAuxiliary.Read(stream, out uint var0);
            Stamina = (int)var0;
        }
    }
    
    public class PlayerSummary : IUnPackable
    {
        public string Name;
        public long PlayerId;
        public int HeadIndex;
        
        public void UnPack(MemoryStream stream)
        {
            UnPackAuxiliary.Read(stream, out Name);
            UnPackAuxiliary.Read(stream, out ulong var0);
            PlayerId = (long)var0;
            UnPackAuxiliary.Read(stream, out uint var1);
            HeadIndex = (int)var1;
        }
    }
    
    public class GetPlayerSummaryQ : IServerCallbackable
    {
        public long PlayerId;
        
        public uint UnPackableId => 89;
        public uint PackableId => 119;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 119u);
            PackAuxiliary.Write(stream, (ulong)PlayerId);
        }
    }
    
    public class GetPlayerSummaryP : IUnPackable
    {
        public PlayerSummary Summary;
        
        public const uint Sid = 89;
        
        public void UnPack(MemoryStream stream)
        {
            Summary = new PlayerSummary();
            Summary.UnPack(stream);
        }
    }
    
    public struct UpgradeSystemLevelQ : IIdPackable
    {
        
        public uint PackableId => 120;
        
        public void Pack(MemoryStream stream)
        {
            PackAuxiliary.Write(stream, 120u);
        }
    }
    
    public enum PlayerEnum
    {
        LoginInfoP,
        DayRefreshP,
        RecoveryStaminaP,
        GetPlayerSummaryP,
    }
}
